﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Trace.cs" company="JDML Consulting Ltd.">
//   Copyright 2011 Photon Project - http://photon.codeplex.com
// </copyright>
// <summary>
//   Writes trace information
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Photon.Diagnostics
{
    /// <summary>
    /// Writes trace information
    /// </summary>
    public static class Trace
    {
        #region Fields

        private static ITraceWriter _traceWriter;

        #endregion

        public static void WriteLine(string text)
        {
            TraceWriter.WriteLine(text);
        }

        public static void WriteLine(string format, params object[] args)
        {
            TraceWriter.WriteLine(format, args);
        }

        /// <summary>
        /// Gets or sets the trace writer.
        /// </summary>
        /// <value>The trace writer.</value>
        public static ITraceWriter TraceWriter
        {
            get
            {
                return _traceWriter ?? (_traceWriter = new DebugTraceWriter());
            }
            set
            {
                _traceWriter = value;
            }
        }
    }
}

